home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / vim-4.2 / src / unixunix.h < prev    next >
C/C++ Source or Header  |  1996-06-09  |  3KB  |  114 lines

  1. /* vi:set ts=4 sw=4:
  2.  *
  3.  * VIM - Vi IMproved        by Bram Moolenaar
  4.  *
  5.  * Do ":help uganda"  in Vim to read copying and usage conditions.
  6.  * Do ":help credits" in Vim to see a list of people who contributed.
  7.  */
  8.  
  9. /*
  10.  * unixunix.h -- include files that are only used in unix.c
  11.  */
  12.  
  13. /*
  14.  * Stuff for signals
  15.  */
  16. #ifdef HAVE_SIGSET
  17. # define signal sigset
  18. #endif
  19.  
  20.    /* sun's sys/ioctl.h redefines symbols from termio world */
  21. #if defined(HAVE_SYS_IOCTL_H) && !defined(sun)
  22. # include <sys/ioctl.h>
  23. #endif
  24.  
  25. #ifndef USE_SYSTEM        /* use fork/exec to start the shell */
  26.  
  27. # if defined(HAVE_SYS_WAIT_H) || defined(HAVE_UNION_WAIT)
  28. #  include <sys/wait.h>
  29. # endif
  30.  
  31. #if defined(HAVE_SYS_SELECT_H) && \
  32.         (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))
  33. #  include <sys/select.h>
  34. # endif
  35.  
  36. # ifndef WEXITSTATUS
  37. #  ifdef HAVE_UNION_WAIT
  38. #   define WEXITSTATUS(stat_val) ((stat_val).w_T.w_Retcode)
  39. #  else
  40. #   define WEXITSTATUS(stat_val) (((stat_val) >> 8) & 0377)
  41. #  endif
  42. # endif
  43.  
  44. # ifndef WIFEXITED
  45. #  ifdef HAVE_UNION_WAIT
  46. #   define WIFEXITED(stat_val) ((stat_val).w_T.w_Termsig == 0)
  47. #  else
  48. #   define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
  49. #  endif
  50. # endif
  51.  
  52. #endif /* !USE_SYSTEM */
  53.  
  54. #ifdef HAVE_STROPTS_H
  55. # include <stropts.h>
  56. #endif
  57.  
  58. #ifdef HAVE_STRING_H
  59. # include <string.h>
  60. #endif
  61.  
  62. #ifndef HAVE_SELECT
  63. # ifdef HAVE_SYS_POLL_H
  64. #  include <sys/poll.h>
  65. # else
  66. #  include <poll.h>
  67. # endif
  68. #endif
  69.  
  70. #ifdef HAVE_SYS_STREAM_H
  71. # include <sys/stream.h>
  72. #endif
  73.  
  74. #ifdef HAVE_SYS_PTEM_H
  75. # include <sys/ptem.h>
  76. # ifndef _IO_PTEM_H            /* For UnixWare that should check for _IO_PT_PTEM_H */
  77. #  define _IO_PTEM_H
  78. # endif
  79. #endif
  80.  
  81. #ifdef HAVE_SYS_UTSNAME_H
  82. # include <sys/utsname.h>
  83. #endif
  84.  
  85. #ifdef HAVE_SYS_SYSTEMINFO_H
  86. /*
  87.  * foolish Sinix <sys/systeminfo.h> uses SYS_NMLN but doesn't include
  88.  * limits.h>, where it is defined. Perhaps other systems have the same
  89.  * problem? Include it here. -- Slootman
  90.  */
  91. # if defined(HAVE_LIMITS_H) && !defined(_LIMITS_H)
  92. #  include <limits.h>           /* for SYS_NMLN (Sinix 5.41 / Unix SysV.4) */
  93. # endif
  94. # include <sys/systeminfo.h>    /* for sysinfo */
  95. #endif
  96.  
  97. /*
  98.  * We use termios.h if both termios.h and termio.h are available.
  99.  * Termios is supposed to be a superset of termio.h.  Don't include them both,
  100.  * it may give problems on some systems (e.g. hpux).
  101.  * I don't understand why we don't want termios.h for apollo.
  102.  */
  103. #if defined(HAVE_TERMIOS_H) && !defined(apollo)
  104. #  include <termios.h>
  105. #else
  106. # ifdef HAVE_TERMIO_H
  107. #  include <termio.h>
  108. # else
  109. #  ifdef HAVE_SGTTY_H
  110. #   include <sgtty.h>
  111. #  endif
  112. # endif
  113. #endif
  114.